package com.yipao.core.mqtt.vo;

import com.yipao.core.util.UUIDUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author voyboy
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MqttSendAdVo implements Serializable {
    /**
     * 机器识别码
     */
    private String deviceNo;
    /**
     * 消息id
     */
    private String messageId;
    /**
     * 事件ID 所有的处理反馈都必须返回事件ID
     */
    private String affairId;
    /**
     * 时间戳,默认当前时间戳
     */
    private Long timestamp;
    /**
     * 指令
     */
    private String cmd;

    /**
     * 操作类型 1 开始制作,3 制作完成通知,4 取货通知,10 广告上传,11 广告删除
     */
    private String ot;

    /**
     * 数据
     */
    private Object message;
    /**
     * 	类型,photo照片,video广告
     */
    private String type;



    public MqttSendAdVo(String deviceNo, Integer cmd, Integer ot) {
        this.timestamp = System.currentTimeMillis();
        this.messageId = UUIDUtil.randomUUID();
        this.deviceNo = deviceNo;
        this.message = new MqttSendMessage(cmd, ot, messageId);
    }

    public MqttSendAdVo(String AId,String deviceNo, Integer cmd, Integer ot, String type) {
        this.affairId=AId;
        this.timestamp = System.currentTimeMillis();
        this.messageId = UUIDUtil.randomUUID();
        this.deviceNo = deviceNo;
        this.message = new MqttSendMessage(cmd, ot, messageId);
        this.type = type;
    }


}
